home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-099.TXT < prev    next >
Encoding:
Text File  |  1992-06-30  |  33.2 KB  |  980 lines

  1. C.S.M.P. Digest             Fri, 29 May 92       Volume 1 : Issue 99
  2.  
  3. Today's Topics:
  4.  
  5.     Prototyping problems THINK C 5.0.2?
  6.     4-byte ints & ThinkC library
  7.     Modeless dialogs with THINK Pascal
  8.     Buy second monitor or CD-ROM?
  9.     StdPutFile Patch
  10.     GlobalToLocal() help?
  11.     good way to relocate cursor?
  12.     TCL - DITL/DLOG - how to use?
  13.     UDP Broadcasts w/ MacTCP 1.1
  14.     Position of SFGetFile dialog, sys6 vs. sys7
  15.     Mac Serial Programming
  16.     Calling XCMDs from normal code (Pascal particularly!)
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. These digests are available (by using FTP, account anonymous, your email
  22. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  23. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  24. Questions list.  The last several issues of the digest are available from
  25. sumex-aim.stanford.edu as well.
  26.  
  27. These digests are also available via email.  Just send a note saying that you
  28. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  29. automatically receive each new digest as it is created.
  30.  
  31. The digest is a collection of articles from the internet newsgroup comp.sys.
  32. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  33. and want an archive of the discussions.  If you don't know what a newsgroup
  34. is, you probably don't have access to it.  Ask your systems administrator(s)
  35. for details.  (This means you can't post questions to the digest.)
  36.  
  37. The articles in these digests are taken directly from comp.sys.mac.programmer.
  38. They are not edited; all articles included in this digest are in their original
  39. posted form.  The only articles that are -not- included in these digests are
  40. those which didn't receive any replies (except those that give information
  41. rather than ask a question).  All replies to each article are concatenated
  42. onto the original article in the order in which they were received.  Article
  43. threads are not added to the digests until the last article added to the
  44. thread is at least one month old (this is to ensure that the thread is dead
  45. before adding it to the digests).
  46.  
  47. Send administrative mail to mkelly@cs.uoregon.edu.
  48.  
  49. -------------------------------------------------------
  50.  
  51. From: alen@crash.cts.com (Alen Shapiro)
  52. Subject: Prototyping problems THINK C 5.0.2?
  53. Date: 20 Apr 92 01:42:58 GMT
  54. Organization: Crash TimeSharing, El Cajon, CA
  55.  
  56. Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
  57. (from TC 4.0 where it works just fine). If I set "require prototypes" OR
  58. uncheck "check pointer types" the following code compiles. If I check
  59. "check pointer types" and either uncheck "strict prototype inforcement" OR
  60. set "infer prototypes", I get an invalid redeclaration.
  61.  
  62. Any takers on this one? Chances are I'm being really stupid and will
  63. end up with egg all over my face (again).
  64.  
  65. Is it possible that "infer prototypes" or non-strict prototyping
  66. mean that prototypes are illegal if found? (back to the manual)
  67.  
  68. - --alen
  69. alen@crash.cts.com
  70. - -------------put this in a .c file and compile---fails even if typedef used---
  71. int apm_init(long, int, short);
  72.  
  73. int
  74. apm_init(ainit, ascaleFactor, abase)
  75.     long ainit;
  76.     int ascaleFactor;
  77.     short abase; {
  78. }
  79.  
  80. +++++++++++++++++++++++++++
  81.  
  82. From: huntley@garbo.cs.indiana.edu (Haydn Huntley)
  83. Date: 20 Apr 92 04:41:51 GMT
  84. Organization: Indiana University, Bloomington
  85.  
  86. In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
  87. >Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
  88. >(from TC 4.0 where it works just fine). If I set "require prototypes" OR
  89. >uncheck "check pointer types" the following code compiles. If I check
  90. >"check pointer types" and either uncheck "strict prototype inforcement" OR
  91. >set "infer prototypes", I get an invalid redeclaration.
  92. >
  93. >Any takers on this one? Chances are I'm being really stupid and will
  94. >end up with egg all over my face (again).
  95. >
  96. >Is it possible that "infer prototypes" or non-strict prototyping
  97. >mean that prototypes are illegal if found? (back to the manual)
  98. >
  99. >--alen
  100. >alen@crash.cts.com
  101. >-------------put this in a .c file and compile---fails even if typedef used---
  102. >int apm_init(long, int, short);
  103. >
  104. >int
  105. >apm_init(ainit, ascaleFactor, abase)
  106. >    long ainit;
  107. >    int ascaleFactor;
  108. >    short abase; {
  109. >}
  110.  
  111. I think the solution to this problem is to convert the above old-style
  112. C function definition, to the new ANSI style, like this:
  113.  
  114. int
  115. apm_init(long ainit, int ascaleFactor, short abase)
  116. {
  117. }
  118.  
  119. It would be a pain to have to convert alot of code like this by hand,
  120. but Think C 5.0 comes with an application named PrototypeHelper, which
  121. you should find in your Think C/Utilities folder.
  122.  
  123. I think it would be more intelligent if Think C would accept both old
  124. and ANSI style definitions, regardless of the settings of those
  125. compiler switches!  Turbo C on the PC does!  :-)
  126.  
  127. - --Haydn
  128. - -- 
  129. ;;  *****************************************************
  130. ;;  *  Haydn Huntley    huntley@copper.ucs.indiana.edu  *
  131. ;;  *****************************************************
  132.  
  133. +++++++++++++++++++++++++++
  134.  
  135. From: russotto@eng.umd.edu (Matthew T. Russotto)
  136. Date: Mon, 20 Apr 92 12:49:18 GMT
  137. Organization: College of Engineering, University of Maryland, College Park
  138.  
  139. In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
  140.  
  141. >"check pointer types" and either uncheck "strict prototype inforcement" OR
  142. >set "infer prototypes", I get an invalid redeclaration.
  143.  
  144. >-------------put this in a .c file and compile---fails even if typedef used---
  145. >int apm_init(long, int, short);
  146. >
  147. >int
  148. >apm_init(ainit, ascaleFactor, abase)
  149. >    long ainit;
  150. >    int ascaleFactor;
  151. >    short abase; {
  152. >}
  153.  
  154. The combination of the prototype and the old-style declaration appear
  155. to be confusing THINK C.  Try going to new-style declarations, i.e.
  156.  
  157. apm_init(long ainit, int ascaleFactor, short abase)
  158.        {
  159. }
  160.  
  161. I found that "Check Pointer Types" had no effect.
  162. - -- 
  163. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  164. Some news readers expect "Disclaimer:" here.
  165. Just say NO to police searches and seizures.  Make them use force.
  166. (not responsible for bodily harm resulting from following above advice)
  167.  
  168. +++++++++++++++++++++++++++
  169.  
  170. From: alen@crash.cts.com (Alen Shapiro)
  171. Date: 20 Apr 92 15:43:26 GMT
  172. Organization: Crash TimeSharing, El Cajon, CA
  173.  
  174. In <1992Apr19.234156.19798@news.cs.indiana.edu> huntley@garbo.cs.indiana.edu (Haydn Huntley) writes:
  175.  
  176. >In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
  177.  
  178. description of failure modes for code below deleted
  179.  
  180. >>int apm_init(long, int, short);
  181. >>
  182. >>int
  183. >>apm_init(ainit, ascaleFactor, abase)
  184. >>    long ainit;
  185. >>    int ascaleFactor;
  186. >>    short abase; {
  187. >>}
  188.  
  189. >I think the solution to this problem is to convert the above old-style
  190. >C function definition, to the new ANSI style, like this:
  191.  
  192. >int
  193. >apm_init(long ainit, int ascaleFactor, short abase)
  194. >{
  195. >}
  196.  
  197. >It would be a pain to have to convert alot of code like this by hand,
  198. >but Think C 5.0 comes with an application named PrototypeHelper, which
  199. >you should find in your Think C/Utilities folder.
  200.  
  201. >I think it would be more intelligent if Think C would accept both old
  202. >and ANSI style definitions, regardless of the settings of those
  203. >compiler switches!  Turbo C on the PC does!  :-)
  204.  
  205. You are right! Certainly seems to work. I did want my code to be easily
  206. portable back to a non-ansi C (like the brain-damaged Sun compiler, where
  207. the price is right, Non-ANSI is free, $2000 for ANSI.)
  208.  
  209. I'd hate to have to "#ifdef sun" every function declaration containing
  210. a short, char or float but I guess I'll have to.
  211.  
  212. thanks. And thanks to everyone else who took the trouble to reply.
  213. - --alen
  214.  
  215. +++++++++++++++++++++++++++
  216.  
  217. From: Dale_Semchishen@mindlink.bc.ca (Dale Semchishen)
  218. Date: 22 Apr 92 06:36:42 GMT
  219. Organization: MIND LINK! - British Columbia, Canada
  220.  
  221. > Alen Shapiro writes:
  222. > I'd hate to have to "#ifdef sun" every function declaration containing
  223. > a short, char or float but I guess I'll have to.
  224.  
  225.  
  226. A good technique for writing portable code is to #define or
  227. typedef all of your data types in an "environment" include file.
  228.   For example:
  229.  
  230.         #define CHAR char
  231.         typedef char CHAR
  232.  
  233. That way when you have to port to a different environment or
  234. compiler all you have to is the "environment" include file.
  235.  
  236.  
  237. - --
  238. Dale Semchishen              | Internet: Dale_Semchishen@mindlink.bc.ca
  239. Personal Designs Inc.        | tel: (604) 590-0056
  240.                              | Vancouver, BC, Canada
  241.  
  242. +++++++++++++++++++++++++++
  243.  
  244. From: hull@ibmb0.cs.uiuc.edu (David Hull)
  245. Organization: University of Illinois at Urbana-Champaign
  246. Date: Thu, 23 Apr 1992 07:08:23 GMT
  247.  
  248. alen@crash.cts.com (Alen Shapiro) writes:
  249.  
  250. >Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
  251. >(from TC 4.0 where it works just fine). If I set "require prototypes" OR
  252. >uncheck "check pointer types" the following code compiles. If I check
  253. >"check pointer types" and either uncheck "strict prototype inforcement" OR
  254. >set "infer prototypes", I get an invalid redeclaration.
  255.  
  256. His code:
  257.  
  258. >int apm_init(long, int, short);
  259.  
  260. >int
  261. >apm_init(ainit, ascaleFactor, abase)
  262. >    long ainit;
  263. >    int ascaleFactor;
  264. >    short abase; {
  265. >}
  266.  
  267. Your prototype is incorrect.  It should be:
  268.  
  269.    int apm_init(long, int, int);
  270.  
  271. So Think C is absolutely right in telling you that you are redeclaring
  272. the function definition.
  273.  
  274. The prototype apm_init(long, int, short) tells the compiler to only
  275. pass a short to the function.  Using the old-style definition,
  276.  
  277. apm_init(ainit, ascaleFactor, abase)
  278. long ainit; int ascaleFactor; short; abase;
  279.  
  280. , the calling routine promotes the third parameter to an int before
  281. calling apm_init, and then apm_init converts it back to a short.
  282.  
  283. - -David
  284.  
  285. +++++++++++++++++++++++++++
  286.  
  287. From: jimc@isc-br.ISC-BR.COM (Jim Cathey)
  288. Date: 27 Apr 92 22:04:44 GMT
  289. Organization: ISC-Bunker Ramo, An Olivetti Company
  290.  
  291. In article <1992Apr23.070823.7045@sunb10.cs.uiuc.edu> David Hull <hull@cs.uiuc.edu> writes:
  292. >>(from TC 4.0 where it works just fine). If I set "require prototypes" OR
  293. >>uncheck "check pointer types" the following code compiles. If I check
  294. >>"check pointer types" and either uncheck "strict prototype inforcement" OR
  295. >>set "infer prototypes", I get an invalid redeclaration.
  296. >>
  297. >>int apm_init(long, int, short);
  298. >>int
  299. >>apm_init(ainit, ascaleFactor, abase)
  300. >>    long ainit;
  301. >>    int ascaleFactor;
  302. >>    short abase; {
  303. >>}
  304. >
  305. >Your prototype is incorrect.  It should be:
  306. >
  307. >   int apm_init(long, int, int);
  308. >
  309. >So Think C is absolutely right in telling you that you are redeclaring
  310. >the function definition.
  311.  
  312. However, there are those of us who insist that ANSI was _wrong_ to
  313. mandate such behavior, and who think the rule should be "The prototype
  314. is always right." In other words, the function definition should be in
  315. "Live with it, Jack" mode, and if it sees (via the prototype) that it's
  316. getting passed the correct type to do nothing, and if it's only getting
  317. passed a flibble instead of a flubble, that it should insert the same
  318. 'as-if assignment' type promotion that it already knows how to do.  It
  319. should be possible to have the best of all possible worlds: Prototypes,
  320. efficient calling sequences, and code that will still compile in a
  321. non-ANSI environment (by #ifdef-ing out the prototypes, which can all
  322. be in one header file).
  323.  
  324. +----------------+
  325. ! II      CCCCCC !  Jim Cathey
  326. ! II  SSSSCC     !  ISC-Bunker Ramo
  327. ! II      CC     !  TAF-C8;  Spokane, WA  99220
  328. ! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
  329. ! II      CCCCCC !  (509) 927-5757
  330. +----------------+
  331.             "PC's --- the junk bonds of the computer industry"
  332.  
  333. ---------------------------
  334.  
  335. From: wong_a@summer.chem.su.oz.au
  336. Subject: 4-byte ints & ThinkC library
  337. Organization: School of Chemistry, University of Sydney
  338. Date: Wed, 29 Apr 1992 01:26:53 GMT
  339.  
  340.  
  341. What's a good workaround for using the ThinkC Standard Library with
  342. 4-byte ints, i.e. in some routines it expects a "short" but the
  343. prototype in the header has "int", and the compiler will ensure the
  344. routine gets a 4-byte int. For example, this won't work,
  345.  
  346.     char        buff[100];
  347.     memset(buff,'\0',sizeof(buff));
  348.  
  349. In this case, memset is sent (long)'\0' instead of (short)'\0'. Short of
  350. changing the header file by hand, what else can be done?
  351.  
  352.  
  353. - -----------------------------------------------------------------------------
  354. Adrian Wong, Dept.of Theoretical Chemistry     wong_a@summer.chem.su.oz.au
  355. University of Sydney NSW 2006 Australia        061-2-692 4137
  356.  
  357. +++++++++++++++++++++++++++
  358.  
  359. From: aw0g+@andrew.cmu.edu (Aaron Wohl)
  360. Date: 28 Apr 92 11:56:28 GMT
  361. Organization: Special Projects, Carnegie Mellon, Pittsburgh, PA
  362.  
  363. When useing 4byte ints you need to copy the ansi library to be ansi-int4
  364. and change it to be 4 byte ints then rebuild. Aaron
  365.  
  366. +++++++++++++++++++++++++++
  367.  
  368. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  369. Date: 28 Apr 92 12:48:16 GMT
  370. Organization: Royal Institute of Technology, Stockholm, Sweden
  371.  
  372.  
  373.  wong_a@summer.chem.su.oz.au writes:
  374.  
  375.    What's a good workaround for using the ThinkC Standard Library with
  376.    4-byte ints, i.e. in some routines it expects a "short" but the
  377.    prototype in the header has "int", and the compiler will ensure the
  378.  
  379. You could follow the manual's advice and re-compile the ANSI library
  380. using the supplied project, but with your compiler options set.
  381. Then name it something bright, like "ANSI 4-byte int" and use it
  382. instead of "ANSI."
  383.  
  384. - -- 
  385. "You should meet yourself someday. I'm sure you would hate it."
  386. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  387.  
  388. ---------------------------
  389.  
  390. From: umdenbo0@ccu.umanitoba.ca (David A. Denboer)
  391. Subject: Modeless dialogs with THINK Pascal
  392. Date: 20 Apr 92 04:09:32 GMT
  393. Organization: University of Manitoba, Winnipeg, Canada
  394.  
  395.  
  396. Could someone please mail me information on how to properly program modeless
  397. dialogs with THINK Pascal?
  398. My events are not getting caught by my event loop, crashing my program.
  399. Thanks
  400.  
  401. umdenbo0@ccu.umanitoba.ca
  402.  
  403. +++++++++++++++++++++++++++
  404.  
  405. From: umdenbo0@ccu.umanitoba.ca (David A. Denboer)
  406. Date: 28 Apr 92 00:28:49 GMT
  407. Organization: University of Manitoba, Winnipeg, Canada
  408.  
  409. In <1992Apr20.040932.21469@ccu.umanitoba.ca> umdenbo0@ccu.umanitoba.ca (David A. Denboer) writes:
  410.  
  411.  
  412. >Could someone please mail me information on how to properly program modeless
  413. >dialogs with THINK Pascal?
  414. >My events are not getting caught by my event loop, crashing my program.
  415. >Thanks
  416.  
  417. >umdenbo0@ccu.umanitoba.ca
  418. Thanks to the people who mailed me information about programming dialog boxes
  419. with Pascal.  Source code from ftp.apple.com helped alot too.
  420. I finally got the damn things working properly with multifinder, and can move
  421. on to better things (modeless dialogs with THINK C)!
  422. If anyone out there has a large music collection and would like a small, 
  423. personal data-base for storing their collections, mail me a line and I will
  424. send my program to you when I am finished testing it.
  425. I still have bugs to work out with my pop-up-menus so it might be a few weeks.
  426. Anyway, thanks to all.
  427.  
  428. umdenbo0@ccu.umanitoba.ca
  429.  
  430. FREDO DIDN'T REALLY DROWN!
  431.  
  432. ---------------------------
  433.  
  434. From: robert@hccwmv2
  435. Subject: Buy second monitor or CD-ROM?
  436. Date: 22 Apr 92 07:27:55 PDT
  437. Organization: Health Care Computer Works, Las Vegas, Nevada
  438.  
  439.   My tax return is coming and I'm thinking of getting either a CD-ROM
  440. or a second monitor (B&W).  I can't make up my mind.  The second monitor
  441. would be great for SADE debugging, but there's a lot of stuff available
  442. on CDs.
  443.   Any suggestions/opinions?
  444.  
  445. (Please post replies, email has a problem getting to me sometimes)
  446.  
  447. Thanks
  448. - -- 
  449. []<>[]  Robert Duran Jr.             []<>[]
  450. <>[]<>  <nevada.edu:hccwmv2!robert>  <>[]<>
  451. []<>[]                               []<>[]
  452.  
  453. +++++++++++++++++++++++++++
  454.  
  455. From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
  456. Date: 25 Apr 92 21:14:22 GMT
  457. Organization: Dartmouth College, Hanover, NH
  458.  
  459. In article <1992Apr22.072756.531@hccwmv2>
  460. robert@hccwmv2 writes:
  461.  
  462. >   My tax return is coming and I'm thinking of getting either a CD-ROM
  463. > or a second monitor (B&W).  I can't make up my mind.  The second monitor
  464. > would be great for SADE debugging, but there's a lot of stuff available
  465. > on CDs.
  466. >   Any suggestions/opinions?
  467.  
  468.  
  469. CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM!
  470.  
  471.  
  472. You can get d e v e l o p for $27 a year, it includes all Tech. Notes,
  473. all Inside Mac, and up to the month info. Also MPW libraries, ResEdit,
  474. MacsBug, and other cool stuff. If you get a NEC CD-Gallery, you get an
  475. encyclopedia, an atlas, a "Time Table of History", and some less useful
  476. stuff. You can also play audio CD's. I have a Mac+ (read "9 in.
  477. screen") and think the CD-Rom drive is worth my aggravations(sp) with
  478. MPW and SADE.
  479.  
  480. Jeremiah
  481.  
  482. +++++++++++++++++++++++++++
  483.  
  484. From: robert@hccwmv2
  485. Date: 28 Apr 92 13:55:46 PDT
  486. Organization: Health Care Computer Works, Las Vegas, Nevada
  487.  
  488. In article <1992Apr25.211422.16269@dartvax.dartmouth.edu>, Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz) writes:
  489. > In article <1992Apr22.072756.531@hccwmv2>
  490. > robert@hccwmv2 writes:
  491. >>   My tax return is coming and I'm thinking of getting either a CD-ROM
  492. >> or a second monitor (B&W).  I can't make up my mind.  The second monitor
  493. >> would be great for SADE debugging, but there's a lot of stuff available
  494. >> on CDs.
  495. >>   Any suggestions/opinions?
  496. > CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM!
  497. > You can get d e v e l o p for $27 a year, it includes all Tech. Notes,
  498. > all Inside Mac, and up to the month info. Also MPW libraries, ResEdit,
  499. > MacsBug, and other cool stuff. If you get a NEC CD-Gallery, you get an
  500. > encyclopedia, an atlas, a "Time Table of History", and some less useful
  501. > stuff. You can also play audio CD's. I have a Mac+ (read "9 in.
  502. > screen") and think the CD-Rom drive is worth my aggravations(sp) with
  503. > MPW and SADE.
  504. > Jeremiah
  505.  
  506.   Great...I was just about settled on a monitor and now this.  With the 
  507. d e v e l o p disk, does it come with a utility for reading and searching
  508. the technical notes?  Do you get sample code?
  509.   Which CD Rom do you have?  Someone mentioned making sure that any
  510. CD Rom you buy is QuickTime compatable, how do I make sure?
  511.  
  512. Geeez, that's a lot of questions, thanks in advance,
  513. - -- 
  514. []<>[]  Robert Duran Jr.             []<>[]
  515. <>[]<>  <nevada.edu:hccwmv2!robert>  <>[]<>
  516. []<>[]                               []<>[]
  517.  
  518. ---------------------------
  519.  
  520. From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
  521. Subject: StdPutFile Patch
  522. Date: 26 Apr 92 18:49:39 GMT
  523. Organization: U. C. Berkeley Open Computing Facility
  524.  
  525.  
  526. For several years I've been waiting for Apple to provide a way to save a file
  527. w/o the hassle of having to click on the Replace button when asked "Replace
  528. existing foobar?"  When system 7 came around I thought that maybe with all
  529. of the new shortcuts I could prehaps hold down the option key or something when
  530. saving so that it would just replace the existing file.  No such luck.  So I
  531. broke down and did a little hacking.  To make the option key bypass the 
  532. "Replace Existing" dialog, make the following changes using ResEdit.  This will
  533. only work on System 7.0 and 7.1.  (And, of course, make the changes on a backup
  534. copy of the system file).
  535.  
  536. PACK #3
  537.  
  538. At offset 9EC change the long word following 'rplc' to $6100 2B2A
  539. Append the following to the end of the resource:
  540.  
  541. 1038   0173  0800  0002
  542. 6700   0006  7D01  4E75
  543. 61FF   FFFF  EB74  4E75
  544.  
  545. That should do it.  When ever you click on the save button (or type opt-return)
  546. the StdFile package will not ask any questions.  The option key is not checked
  547. for at the exact same time as the event is recorded (it is checked for just
  548. before the dialog is to be brought up).  So you may have to hold down the
  549. option key for a moment in order for it to register on 9 inch macs.  
  550.  
  551. If you have any problems with this (or a better solution) send replys to
  552. ewylie@ocf.berkeley.edu.
  553.  
  554. - -Elizabeth Wylie
  555.  
  556. +++++++++++++++++++++++++++
  557.  
  558. From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
  559. Date: 28 Apr 92 01:43:52 GMT
  560. Organization: U. C. Berkeley Open Computing Facility
  561.  
  562.  
  563. I have just been informed of two typos I made in my recent atricle on patching
  564. pack resource #3.  The correct hexidecimal is below.  I apologize for any
  565. crashing, etc.  (This is pretty embarassing).
  566.  
  567. Append to the pack 3 resource in the system file:
  568.  
  569. 1038  017B  0800  0002    (017B was 0173)
  570. 6700  0006  7001  4E75    (7001 was 7D01)
  571. 61FF  FFFF  EB74  4E75
  572.  
  573. Definitley time to invest in a pair of glasses.
  574.  
  575. Again, apologies.
  576.  
  577. - -Elizabeth Wylie
  578. .
  579.  
  580. ---------------------------
  581.  
  582. From: erik@archimedes.nwc.navy.mil (Erik van bronkhorst)
  583. Subject: GlobalToLocal() help?
  584. Date: 27 Apr 92 10:38:38 GMT
  585. Organization: Naval Weapons Center, China Lake, CA
  586.  
  587. Environment:
  588. Sys 7.01 (not 1.1 or 1.1.1)
  589. Think C 5.01
  590.  
  591. No matter what, GlobalToLocal seems to have no effect.  I have to
  592. manually offset the position of radio buttons in windows for the
  593. right one to get selected.
  594.  
  595. Also, my SfGetFile won't display the "message".  SfPutfile does.
  596.  
  597. Any suggestions will help.  Thanks
  598. - -- 
  599. Erik van Bronkhorst KC6UUT erik@rftech.nwc.navy.mil
  600. DoD#4342585443 AMA#438054 "3.412 squid" "2.5 geezer"
  601.  
  602. +++++++++++++++++++++++++++
  603.  
  604. From: keith@taligent.com (Keith Rollin)
  605. Date: 28 Apr 92 20:48:08 GMT
  606. Organization: Taligent
  607.  
  608. In article <1992Apr27.103838.20714@avalon.nwc.navy.mil>,
  609. erik@archimedes.nwc.navy.mil (Erik van bronkhorst) writes:
  610. > Also, my SfGetFile won't display the "message".  SfPutfile does.
  611.  
  612. >From Inside Mac I, page 523:
  613.  
  614. "The prompt parameter is ignored; it's there for historical purposes only."
  615.  
  616. - --
  617. Keith Rollin
  618. Phantom Programmer
  619. Taligent, Inc.
  620.  
  621. ---------------------------
  622.  
  623. From: bruce2@unix.cis.pitt.edu (Bruce A Bollinger)
  624. Subject: good way to relocate cursor?
  625. Date: 27 Apr 92 19:05:42 GMT
  626. Organization: Univ. of Pittsburgh, Comp & Info Sys
  627.  
  628.  
  629.     I have a quick question that I hope someone can help me with. The
  630. problem being, I want to disallow any cursor movement into a small Rect on the
  631. screen. Is there some way to force the location of the cursor to remain at
  632. the boundry until the mouse is moved vertically up or horizontally? I wish no 
  633. flickering of HideCursor and redrawing.
  634.     I saw something simular in the UMPG but the code uses undocumented calls
  635. and variables. I would like guidance to finding good examples.
  636.  
  637. Thanks,
  638. Bruce2@unix.cis.pitt.edu
  639.  
  640. +++++++++++++++++++++++++++
  641.  
  642. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  643. Date: 27 Apr 92 21:17:52 GMT
  644. Organization: Kalamazoo College
  645.  
  646. bruce2@unix.cis.pitt.edu (Bruce A Bollinger) writes:
  647. >
  648. >    I have a quick question that I hope someone can help me with. The
  649. >problem being, I want to disallow any cursor movement into a small Rect on the
  650. >screen. Is there some way to force the location of the cursor to remain at
  651. >the boundry until the mouse is moved vertically up or horizontally? I wish no 
  652. >flickering of HideCursor and redrawing.
  653. >    I saw something simular in the UMPG but the code uses undocumented calls
  654. >and variables. I would like guidance to finding good examples.
  655.  
  656. There isn't a good way unless you bypass Apple's cursor.  You can
  657. constrain it to a given rectangle by setting certain locations, but it
  658. breaks on later machines (and later operating systems).
  659.  
  660. The best method is to hide the real cursor and install your own cursor
  661. routine as a vertical blanking task.  But writing a fast routine for any
  662. bit depth is no fun.  Making it track the real cursor when either (1)
  663. your tracking area or (2) the union of all attached screens is
  664. non-rectangular, is not easy, and it's impossible to do it right.
  665. Process switching would be a UI nightmare, and you don't want to think
  666. about displaying it on multiple monitors.
  667.  
  668. So don't constrain the cursor.  Let it be free.
  669.  
  670. It sounds like you're doing animation in a rectangle.  Consider using
  671. ShieldCursor() (IM I-474) or HideCursor() (IM I-168) instead, balanced
  672. by ShowCursor() when the animation's over.
  673. - -- 
  674.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  675.  "Also thanks to:  Inside Macintosh (except vol. V, ch. 27)"
  676.    - the Tesserae "About..." box
  677.  
  678. ---------------------------
  679.  
  680. From: awmin@athena.mit.edu (Art Min)
  681. Subject: TCL - DITL/DLOG - how to use?
  682. Date: 29 Apr 92 05:47:55 GMT
  683. Organization: Massachusetts Institute of Technology
  684.  
  685. Okay, I need help - I'm trying to implement Dialog Boxes in
  686. TCL. Okay, I know that there are some classes in the Dialog Classes
  687. Folder, but I'm not sure how to use tem since they're not in the
  688. manual for Think C 5.0! I tried to "manually" do them with direct
  689. calls with the Toolbox but it's not happy.
  690.  
  691. SO COULD ANYBODY who knows how to call up a DLOG resource and then
  692. get information from it. I know how to do it "manually", but I need
  693. a guide through how to use it with TCL.
  694.  
  695. Thanks a lot!
  696.  
  697. Please email response - it's easier that way.
  698.  
  699. Art 
  700.  
  701. awmin@athena.mit.edu
  702.  
  703.  
  704. - --
  705. ******************************************************************************
  706. * Art Min        *    Learn from the past, Live in the present,    *
  707. * awmin@athena.mit.edu    *    and hope for the future.                     *
  708. ******************************************************************************
  709.  
  710. +++++++++++++++++++++++++++
  711.  
  712. From: awmin@athena.mit.edu (Art Min)
  713. Date: 29 Apr 92 05:57:32 GMT
  714. Organization: Massachusetts Institute of Technology
  715.  
  716. Okay, I need help - I'm trying to implement Dialog Boxes in
  717. TCL. Okay, I know that there are some classes in the Dialog Classes
  718. Folder, but I'm not sure how to use tem since they're not in the
  719. manual for Think C 5.0! I tried to "manually" do them with direct
  720. calls with the Toolbox but it's not happy.
  721.  
  722. SO COULD ANYBODY who knows how to call up a DLOG resource and then
  723. get information from it. I know how to do it "manually", but I need
  724. a guide through how to use it with TCL.
  725.  
  726. Thanks a lot!
  727.  
  728. Please email response - it's easier that way.
  729.  
  730. Art 
  731.  
  732. awmin@athena.mit.edu
  733.  
  734. - --
  735. ******************************************************************************
  736. * Art Min        *    Learn from the past, Live in the present,    *
  737. * awmin@athena.mit.edu    *    and hope for the future.                     *
  738. ******************************************************************************
  739.  
  740. ---------------------------
  741.  
  742. From: hjelm+@cs.cmu.edu (Mark Hjelm)
  743. Subject: UDP Broadcasts w/ MacTCP 1.1
  744. Date: Mon, 27 Apr 92 21:29:29 GMT
  745. Organization: School of Computer Science, Carnegie Mellon
  746.  
  747.  
  748. I may be missing something obvious, but...
  749.  
  750. How do I receive UDP broadcast packets with MacTCP 1.1?  Sending them
  751. seems to work fine.
  752.  
  753. Thanks,
  754. Mark Hjelm
  755. hjelm@cs.cmu.edu
  756.  
  757. +++++++++++++++++++++++++++
  758.  
  759. From: hjelm+@cs.cmu.edu (Mark Hjelm)
  760. Date: 28 Apr 92 17:46:07 GMT
  761. Organization: School of Computer Science, Carnegie Mellon
  762.  
  763. In article <whatever> I wrote:
  764. >
  765. >I may be missing something obvious, but...
  766. >
  767. >How do I receive UDP broadcast packets with MacTCP 1.1?  Sending them
  768. >seems to work fine.
  769. >
  770.  
  771. I was right.  I was missing something obvious, like using a MacTCP
  772. driver I hadn't trashed.  I didn't notice until I tried using telnet,
  773. since UDP kindof worked.  Everything works fine now, in the obvious
  774. manner.  Sigh.
  775.  
  776.  
  777. Mark Hjelm
  778. hjelm@cs.cmu.edu
  779.  
  780. ---------------------------
  781.  
  782. From: jcr@mbunix.mitre.org (Rogers)
  783. Subject: Position of SFGetFile dialog, sys6 vs. sys7
  784. Organization: The MITRE Corporation, Bedford, MA
  785. Date: Mon, 27 Apr 1992 21:38:57 GMT
  786.  
  787. I'd like my program to position the SFGetFile (& SFPutFile) dialog nicely
  788. under both sys6 & sys7. The following code positions it automatically
  789. under 7:
  790.  
  791.   Point       ULCorner ;
  792.   SFTypeList  typeList ;
  793.   SFReply     sfReply ;
  794.  
  795.   ULCorner.h =  0 ;
  796.   ULCorner.v =  0 ;
  797.   SFGetFile( ULCorner, "\p", (FileFilterProcPtr)0, -1, &typeList,
  798.                     (DlgHookProcPtr)0, &sfReply ) ;
  799.  
  800. But under 6, I have to position it manually by changing the assignment of
  801. ULCorner to something like the following:
  802.  
  803.   ULCorner.h =
  804.     (screenBits.bounds.left + screenBits.bounds.right - SFDialogWidth)/2 ;
  805.   ULCorner.v =
  806.     (screenBits.bounds.top + screenBits.bounds.bottom - SFDialogHeight)/2 ;
  807.  
  808. But I don't know how to find "SFDialogWidth" & "SFDialogHeight". I know
  809. they're stored in the dialog resources (-3999 & -4000) of the system
  810. file. Is it safe to hard-wire the values given in IM vol.1? Or is there
  811. a different and better approach?
  812.  
  813. Can anyone help?
  814.  
  815. - --- Jeff Rogers
  816.     jcr@mbunix.mitre.org
  817.  
  818.  
  819. +++++++++++++++++++++++++++
  820.  
  821. From: U21192@uicvm.uic.edu (John Galidakis)
  822. Date: 28 Apr 92 02:10:42 GMT
  823. Organization: University of Illinois at Chicago
  824.  
  825.  
  826.  Yes there IS a way to do this; Just call GetNewDialog instead:
  827.  
  828.  
  829. GetSelection:=GetNewDialog(-4000,nil,Pointer(-1));
  830. with ScreenBits.Bounds do
  831. begin
  832. ScreenSize.h:=Right-Left;...v:=Bottom-Top;
  833. end;
  834. with GetSelection^.PortRect do
  835. begin
  836. DialogSize.h:=Right-Left;DialogSize.v:=Bottom-Top;
  837. end;
  838. {now prepare the "where of SFGetFile"}
  839. Where.h:=ScreenSize.h div 2-DialogSize.h div 2;
  840. ......v:=...........v..................v.......
  841. TypeList[0]:=whatever;
  842. SFGetFile(where,'',nil,n,TypeList,nil,Reply);
  843. - ---------------------------------------------
  844. The getnewdialog call loads the resources, and SFGetFile actually displays.
  845. (or so I think)
  846. John "the Baptist" Galidakis
  847. Paranoid Evangelist.
  848. **** "Only JCN won the game with the great Goddess. The rest just tried..."
  849.  
  850. ---------------------------
  851.  
  852. From: putzolu@toadflax.cs.ucdavis.edu (David Putzolu)
  853. Subject: Mac Serial Programming
  854. Date: 27 Apr 92 23:16:15 GMT
  855. Organization: Department of Computer Science, University of California, Davis
  856.  
  857. A friend of mine is doing a project that involves communicating
  858. over the serial port being synchronized with drawing to the
  859. screen.  He is a fairly experienced programmer,
  860. but does not know how to do what he wants to on the
  861. Mac. If anyone could help with the following questions by sending
  862. him email it would be really great. Thanks!
  863.  
  864. (His address is harrison@CAESAR.ucdavis.edu)
  865.  
  866. 1) How is the communications toolbox used? Is the CTB development
  867.    kit really necessary?
  868. 2) Are there any really good books on programming the serial port
  869.    available, for the CTB or not? Preferably for Think C v.5.
  870. 3) Are there other ways to time animation without using the Time
  871.    Manager since you cannot call toolbox routines that call the Memory
  872.    Manager (such as drawing routines) from a Time Manager started
  873.    routine?
  874.  
  875. Thanks again!
  876.  
  877. | David M. A. Putzolu                  | putzolu@cs.ucdavis.edu                |
  878. | Senior Undergraduate                 | op disclaimer(opinion : ptr mine)     |
  879. | Computer Science and Psychology      |       Aiuto! Sono caduto e            |
  880. | University of California at Davis    |         non posso alzarmi!            |
  881.  
  882. +++++++++++++++++++++++++++
  883.  
  884. From: mspace@netcom.com (Brian Hall)
  885. Date: 27 Apr 92 23:51:46 GMT
  886. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  887.  
  888. In article <12731@ucdavis.ucdavis.edu> putzolu@toadflax.cs.ucdavis.edu (David Putzolu) writes:
  889. >1) How is the communications toolbox used? Is the CTB development
  890. >   kit really necessary?
  891. >2) Are there any really good books on programming the serial port
  892. >   available, for the CTB or not? Preferably for Think C v.5.
  893.  
  894. 1- If you have System 7, you could get by with just the Addison Wesley
  895. book since the CTB is included with Sys7, if not (and perhaps even if you d0)
  896. you might want to consider the $100 CTB Package from APDA which includes the
  897. latest software, plust the Addison-Wesley book, plus a disk for CTB 1.1.
  898. I would also suggest ordering the Basic COnnectivity Set from APDA for
  899. $50, as well as downloading the Hayes Modem Tool from America Online.
  900.  
  901. 2- The Addison Wesley book covers things pretty well, and if you want
  902. some example code, APDA has sample code for sale from a sample CTB based
  903. terminal program to Tools that handle file xfer, connection, etc.
  904.  
  905.  
  906. - -- 
  907.  
  908.  \ | /   | Brian Hall                 mspace@netcom.com
  909.  - : -   | Mark/Space Softworks       Applelink: markspace
  910.   /|\    |                            America Online: MarkSpace
  911.  |-+-|   |
  912. /-\|/-\  | People don't kill people, toasters kill people.
  913.  
  914. ---------------------------
  915.  
  916. From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
  917. Subject: Calling XCMDs from normal code (Pascal particularly!)
  918. Date: 28 Apr 92 03:12:35 GMT
  919. Organization: Computer Science, University of Melbourne, Australia
  920.  
  921. I'd really love to know how to call a code resource from source code, specific-
  922. ally calling an XCMD from Pascal. Obviously I need to pass it an XCMDPtr, but
  923. how!!!!
  924.  
  925. I would be most grateful if someone could point me in the right direction.
  926.  
  927. Thanks very much,
  928.     Mike Cutter.
  929.  
  930. +++++++++++++++++++++++++++
  931.  
  932. From: potts@itl.itd.umich.edu (Paul Potts)
  933. Organization: Instructional Technology Laboratory, University of Michigan
  934. Date: Tue, 28 Apr 92 17:27:19 GMT
  935.  
  936. In article <9211913.11075@mulga.cs.mu.OZ.AU> mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER) writes:
  937. >I'd really love to know how to call a code resource from source code, specific-
  938. >ally calling an XCMD from Pascal. Obviously I need to pass it an XCMDPtr, but
  939. >how!!!!
  940. >
  941. >I would be most grateful if someone could point me in the right direction.
  942.  
  943. There are a couple of approaches. If you have the source code to the XCMD,
  944. you can add the files to your project and then call it directly by faking it
  945. out - sending it a phoney XCMDPtr. This won't work if you need to support
  946. callbacks into Hypercard or windows, but I've added several of my own XCMDs
  947. to a THINK C project with this method. 
  948.  
  949. If you just have a code resource, it gets harder. You'll have to load the
  950. resource, set up your XCMD paramblock and pointer and jump to it. You won't
  951. be able to support callbacks or external windows. Someone else will have
  952. to offer advice on this part - I've never done it (it sounds a little tricky)...
  953. >
  954. >Thanks very much,
  955. >    Mike Cutter.
  956. >
  957.  
  958.  
  959. - -- 
  960. Paul Potts - potts@itl.itd.umich.edu
  961. Un damne' descendant sans lampe,/ Au bord d'un gouffre dont l'odeur
  962. Trahit l'humide profondeur,/ D'e'ternels escaliers sans rampe... 
  963.    -Baudelaire on DOS/Windows programming   
  964.  
  965. ---------------------------
  966.  
  967. End of C.S.M.P. Digest
  968. **********************
  969.